#{include file="wxapp/head.html"}# 
<!-- page 容器 -->
<div class="page"> 
  <!-- 标题栏 -->
  <header class="bar bar-nav">
    <h1 class="title">系统登录</h1>
  </header>
  
  <!-- 工具栏 -->
  <nav class="bar bar-tab"> <a class="tab-item external" href="#">版权所有 零起飞网络</a> </nav>
  
  <!-- 这里是页面内容区 -->
  <div class="content">
   <form name="myform" method="post" action="#{$smarty.const.ACT}#/Login/login" external>
    <div class="list-block">
      <ul>
        <!-- Text inputs -->
        <li>
          <div class="item-content">
            <div class="item-inner">
              <div class="item-title label">姓名</div>
              <div class="item-input">
                <input type="text" name="username" id="username"  placeholder="你的帐号">
              </div>
            </div>
          </div>
        </li>
        <li>
          <div class="item-content">
            <div class="item-inner">
              <div class="item-title label">密码</div>
              <div class="item-input">
                <input type="password" name="password" id="password" placeholder="输入密码">
              </div>
            </div>
          </div>
        </li>
      </ul>
    </div>
    <div class="content-block">
      <div class="row">
        <div class="col-50"><input type="submit" class="button button-big button-fill" value="登录"></div>
        <div class="col-50"><a href="#" class="button button-big button-fill button-danger">重置</a></div>
      </div>
    </div>
    </form>
  </div>
</div>
<script type="text/javascript">
$(function() {
	var postdata=$('#form').serialize();    
	$('.button-success').on('click', function() {
		$.ajax({
			url:'#{$smarty.const.ACT}#/Login/login/',
			type:'POST', //GET
			async:true,    //或false,是否异步
			data:postdata,
			timeout:5000,    //超时时间
			dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
			beforeSend:function(xhr){
				console.log(xhr)
				console.log('发送前')
			},
			success:function(data,textStatus,jqXHR){
				console.log(data)
				console.log(textStatus)
				console.log(jqXHR)
			},
			error:function(xhr,textStatus){
				console.log('错误')
				console.log(xhr)
				console.log(textStatus)
			},
			complete:function(){
				console.log('结束')
			}
		})
	});
});
</script>
#{include file="wxapp/foot.html"}#